package com.fypg.module.medical.dal.mysql.outpatientorderdetail;

import java.util.*;

import com.fypg.framework.common.pojo.PageResult;
import com.fypg.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.fypg.framework.mybatis.core.mapper.BaseMapperX;
import com.fypg.module.medical.dal.dataobject.outpatientorderdetail.OutpatientOrderDetailDO;
import org.apache.ibatis.annotations.Mapper;
import com.fypg.module.medical.controller.admin.outpatientorderdetail.vo.*;

/**
 * 门诊订单详情 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OutpatientOrderDetailMapper extends BaseMapperX<OutpatientOrderDetailDO> {

    default PageResult<OutpatientOrderDetailDO> selectPage(OutpatientOrderDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OutpatientOrderDetailDO>()
                .eqIfPresent(OutpatientOrderDetailDO::getOutpatientOrderId, reqVO.getOutpatientOrderId())
                .likeIfPresent(OutpatientOrderDetailDO::getProjectName, reqVO.getProjectName())
                .eqIfPresent(OutpatientOrderDetailDO::getUnit, reqVO.getUnit())
                .eqIfPresent(OutpatientOrderDetailDO::getUnitPrice, reqVO.getUnitPrice())
                .eqIfPresent(OutpatientOrderDetailDO::getSpec, reqVO.getSpec())
                .eqIfPresent(OutpatientOrderDetailDO::getNumber, reqVO.getNumber())
                .eqIfPresent(OutpatientOrderDetailDO::getPayFee, reqVO.getPayFee())
                .eqIfPresent(OutpatientOrderDetailDO::getExtendData, reqVO.getExtendData())
                .eqIfPresent(OutpatientOrderDetailDO::getSortCode, reqVO.getSortCode())
                .eqIfPresent(OutpatientOrderDetailDO::getEnabledMark, reqVO.getEnabledMark())
                .eqIfPresent(OutpatientOrderDetailDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(OutpatientOrderDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OutpatientOrderDetailDO::getId));
    }

}